package com.smm.web.vmc;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@EnableTransactionManagement
@SpringBootApplication
public class App extends SpringBootServletInitializer {


    public static void main(String[] args) {

        SpringApplication.run(App.class, args);
        System.out.println("app main");


        String condition="{\"cameraIds\":[4,1],\"tags\":[{\"no\":\"030000FB\",\"cameraId\":1},{\"no\":\"030000FA\",\"cameraId\":4}]}";

        JSONObject obj = JSON.parseObject(condition);

        JSONArray tags = (JSONArray) obj.get("tags");

        for(Object tagItem : tags){

            JSONObject tag = (JSONObject) tagItem;

            System.out.println(tag.get("no"));
            System.out.println(tag.get("cameraId"));

        }







    }


}
